

//获取路径携带信息
var loc = location.href,
    n1 = loc.length,//地址的总长度
    n2 = loc.indexOf("="),//取得=号的位置
    id = decodeURI(loc.substr(n2 + 1, n1 - n2));

console.log(id)
var $,
    layer;

layui.use(['jquery', 'layer'], function () {
    $ = layui.jquery,
        layer = layui.layer;

    $.ajax({
        url: '/Dept/getById',
        type: 'post',
        data: {'id': id},
        dataType: 'json',
        success: function (item) {
            $('input[name=deptName]').val(item.data.deptName);
            $('input[name=createName]').val(item.data.createName);
            $('input[name=createDate]').val(item.data.createDate);
            $('textarea[name=deptDescirbe]').val(item.data.deptDescirbe);
        }
    });
});